package net.orange.architecture.web;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.model.SelectItem;

/**
 * Web control helper, which can generate some object for page,like "True/False"
 * selection.
 */
@ManagedBean(name="webhelper")
@SessionScoped
public class WebHelper {
	/**
	 * Return the select item (true or false) for selection component.
	 * 
	 * @return the collection of select item (true or false).
	 * @throws Exception
	 */
	public Collection getBooleans() throws Exception {
		List<SelectItem> list = new ArrayList<SelectItem>();

		list.add(new SelectItem(Boolean.FALSE, "False"));
		list.add(new SelectItem(Boolean.TRUE, "True"));

		return list;
	}
}
